package com.exption;


import lombok.Data;
import lombok.Getter;
import lombok.Setter;

@Getter
public enum ExceptionEnum {
    ERRRO(1005,"抓少女失败"),
    OK(1001,"抓少女成功"),
    NULL(1003,"没有少女"),
    UNKNOW(1004,"");
    ;
    private int code;
    private String msg;
   ExceptionEnum(int code,String msg){
       this.code = code;
       this.msg = msg;
   }
   public static ExceptionEnum codeOf(int code){
       for(ExceptionEnum v:values()){
           if(v.code == code){
               return v;
           }
       }
       return  null;
   }
   public static ExceptionEnum unkonwMsg(String msg){
      UNKNOW.msg = msg;
      return UNKNOW;
   }

}
